package com.cheng.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cheng.common.exception.CommonException;
import com.cheng.common.utils.StringUtil;
import com.cheng.data.entity.EntpTypeInfEntity;
import com.cheng.data.mapper.EntpTypeInfMapper;
import com.cheng.service.EntpTypeInfService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: ChengJW
 * @date: 2021/11/8 8:28
 * @version: 1.0
 * @description: 企业类型 entp_type_info 表操作
 */
@Service
public class EntpTypeInfServiceImpl implements EntpTypeInfService {

    private final static Logger log = LoggerFactory.getLogger(EntpTypeInfServiceImpl.class);

    @Autowired
    private EntpTypeInfMapper entpTypeInfMapper;

    /**
    * @author: ChengJW
    * @params: [entpTypeInfEntity]
    * @return: java.util.List<com.cheng.data.entity.EntpTypeInfEntity>
    * @date: 2021/11/8
    * @description: 查询企业类型信息
    */
    @Override
    public List<EntpTypeInfEntity> queryEntpTypeInf(EntpTypeInfEntity entpTypeInfEntity) throws CommonException{

        QueryWrapper<EntpTypeInfEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtil.isNotNull(entpTypeInfEntity.getEpTypeCode()),"ep_type_code",entpTypeInfEntity.getEpTypeCode());
        return entpTypeInfMapper.selectList(wrapper);
    }
}
